package com.pwx.web.controller;

import com.pwx.entity.Dept;
import com.pwx.services.DeptServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Copyright (C),2021-2022,亚瑟王
 * FileName: DeptController
 * Author: saber
 * Date:2022/10/4 15:39
 */
@Controller
@RequestMapping("/dept")
public class DeptController {
    @Autowired
    private DeptServices ds;

    @RequestMapping(value = "/getAllByDept",method = RequestMethod.GET)
    @ResponseBody
    public List<Dept> getAllByDept(){
        List<Dept> deptList = ds.getAll();
        return deptList;
    }

} 
